﻿Public Class clsFuelConsumption

    Private _LitrePer100KM As Double
    Public Property LitrePer100KM() As Double
        Get
            Return _LitrePer100KM
        End Get
        Set(ByVal value As Double)
            _LitrePer100KM = value
        End Set
    End Property

    Private _PriceOf20Litres As Double
    Public Property PriceOf20Litres() As Double
        Get
            Return _PriceOf20Litres
        End Get
        Set(ByVal value As Double)
            _PriceOf20Litres = value
        End Set
    End Property

    Private _Distance As Double 'in meter
    Public Property Distance() As Double
        Get
            Return _Distance
        End Get
        Set(ByVal value As Double)
            _Distance = value
            Me.Litres = (Me.LitrePer100KM * _Distance) / 100000
            Me.Cost = (Me.PriceOf20Litres * Me.Litres) / 20
        End Set
    End Property

    Private _Litres As Double
    Public Property Litres() As Double
        Get
            Return _Litres
        End Get
        Private Set(ByVal value As Double)
            _Litres = value
        End Set
    End Property

    Private _Cost As Double
    Public Property Cost() As Double
        Get
            Return _Cost
        End Get
        Private Set(ByVal value As Double)
            _Cost = value
        End Set
    End Property
End Class
